<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>Constants &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script type="text/javascript" src="../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../about.html" >
    <link rel="index" title="Index" href="../genindex.html" >
    <link rel="search" title="Search" href="../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../index.html" >
    <link rel="up" title="NumPy Reference" href="index.html" >
    <link rel="next" title="Universal functions (ufunc)" href="ufuncs.html" >
    <link rel="prev" title="Datetimes and Timedeltas" href="arrays.datetime.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../index.html">
      <img border=0 alt="NumPy" src="../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="index.html" accesskey="U">NumPy Reference</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="ufuncs.html" title="Universal functions (ufunc)"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="arrays.datetime.html" title="Datetimes and Timedeltas"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="arrays.datetime.html"
                        title="previous chapter">Datetimes and Timedeltas</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="ufuncs.html"
                        title="next chapter">Universal functions (<code class="xref py py-class docutils literal notranslate"><span class="pre">ufunc</span></code>)</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="module-numpy.doc.constants">
<span id="constants"></span><h1>Constants<a class="headerlink" href="#module-numpy.doc.constants" title="Permalink to this headline">¶</a></h1>
<p>NumPy includes several constants:</p>
<dl class="data">
<dt id="numpy.Inf">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">Inf</code><a class="headerlink" href="#numpy.Inf" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of (positive) infinity.</p>
<p>Use <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a> because <a class="reference internal" href="#numpy.Inf" title="numpy.Inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Inf</span></code></a>, <a class="reference internal" href="#numpy.Infinity" title="numpy.Infinity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Infinity</span></code></a>, <a class="reference internal" href="#numpy.PINF" title="numpy.PINF"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PINF</span></code></a> and <a class="reference internal" href="#numpy.infty" title="numpy.infty"><code class="xref py py-obj docutils literal notranslate"><span class="pre">infty</span></code></a> are aliases for
<a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>. For more details, see <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>.</p>
<p class="rubric">See Also</p>
<p>inf</p>
</dd></dl>

<dl class="data">
<dt id="numpy.Infinity">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">Infinity</code><a class="headerlink" href="#numpy.Infinity" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of (positive) infinity.</p>
<p>Use <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a> because <a class="reference internal" href="#numpy.Inf" title="numpy.Inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Inf</span></code></a>, <a class="reference internal" href="#numpy.Infinity" title="numpy.Infinity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Infinity</span></code></a>, <a class="reference internal" href="#numpy.PINF" title="numpy.PINF"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PINF</span></code></a> and <a class="reference internal" href="#numpy.infty" title="numpy.infty"><code class="xref py py-obj docutils literal notranslate"><span class="pre">infty</span></code></a> are aliases for
<a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>. For more details, see <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>.</p>
<p class="rubric">See Also</p>
<p>inf</p>
</dd></dl>

<dl class="data">
<dt id="numpy.NAN">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">NAN</code><a class="headerlink" href="#numpy.NAN" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of Not a Number (NaN).</p>
<p><a class="reference internal" href="#numpy.NaN" title="numpy.NaN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NaN</span></code></a> and <a class="reference internal" href="#numpy.NAN" title="numpy.NAN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NAN</span></code></a> are equivalent definitions of <a class="reference internal" href="#numpy.nan" title="numpy.nan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">nan</span></code></a>. Please use
<a class="reference internal" href="#numpy.nan" title="numpy.nan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">nan</span></code></a> instead of <a class="reference internal" href="#numpy.NAN" title="numpy.NAN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NAN</span></code></a>.</p>
<p class="rubric">See Also</p>
<p>nan</p>
</dd></dl>

<dl class="data">
<dt id="numpy.NINF">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">NINF</code><a class="headerlink" href="#numpy.NINF" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of negative infinity.</p>
<p class="rubric">Returns</p>
<dl class="simple">
<dt>y<span class="classifier">float</span></dt><dd><p>A floating point representation of negative infinity.</p>
</dd>
</dl>
<p class="rubric">See Also</p>
<p>isinf : Shows which elements are positive or negative infinity</p>
<p>isposinf : Shows which elements are positive infinity</p>
<p>isneginf : Shows which elements are negative infinity</p>
<p>isnan : Shows which elements are Not a Number</p>
<p>isfinite : Shows which elements are finite (not one of Not a Number,
positive infinity and negative infinity)</p>
<p class="rubric">Notes</p>
<p>NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.
Also that positive infinity is not equivalent to negative infinity. But
infinity is equivalent to positive infinity.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">NINF</span>
<span class="go">-inf</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">-inf</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="numpy.NZERO">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">NZERO</code><a class="headerlink" href="#numpy.NZERO" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of negative zero.</p>
<p class="rubric">Returns</p>
<dl class="simple">
<dt>y<span class="classifier">float</span></dt><dd><p>A floating point representation of negative zero.</p>
</dd>
</dl>
<p class="rubric">See Also</p>
<p>PZERO : Defines positive zero.</p>
<p>isinf : Shows which elements are positive or negative infinity.</p>
<p>isposinf : Shows which elements are positive infinity.</p>
<p>isneginf : Shows which elements are negative infinity.</p>
<p>isnan : Shows which elements are Not a Number.</p>
<dl class="simple">
<dt>isfinite<span class="classifier">Shows which elements are finite - not one of</span></dt><dd><p>Not a Number, positive infinity and negative infinity.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). Negative zero is considered to be a finite number.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">NZERO</span>
<span class="go">-0.0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">PZERO</span>
<span class="go">0.0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">isfinite</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">NZERO</span><span class="p">])</span>
<span class="go">array([ True])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">NZERO</span><span class="p">])</span>
<span class="go">array([False])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">isinf</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">NZERO</span><span class="p">])</span>
<span class="go">array([False])</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="numpy.NaN">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">NaN</code><a class="headerlink" href="#numpy.NaN" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of Not a Number (NaN).</p>
<p><a class="reference internal" href="#numpy.NaN" title="numpy.NaN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NaN</span></code></a> and <a class="reference internal" href="#numpy.NAN" title="numpy.NAN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NAN</span></code></a> are equivalent definitions of <a class="reference internal" href="#numpy.nan" title="numpy.nan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">nan</span></code></a>. Please use
<a class="reference internal" href="#numpy.nan" title="numpy.nan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">nan</span></code></a> instead of <a class="reference internal" href="#numpy.NaN" title="numpy.NaN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NaN</span></code></a>.</p>
<p class="rubric">See Also</p>
<p>nan</p>
</dd></dl>

<dl class="data">
<dt id="numpy.PINF">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">PINF</code><a class="headerlink" href="#numpy.PINF" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of (positive) infinity.</p>
<p>Use <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a> because <a class="reference internal" href="#numpy.Inf" title="numpy.Inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Inf</span></code></a>, <a class="reference internal" href="#numpy.Infinity" title="numpy.Infinity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Infinity</span></code></a>, <a class="reference internal" href="#numpy.PINF" title="numpy.PINF"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PINF</span></code></a> and <a class="reference internal" href="#numpy.infty" title="numpy.infty"><code class="xref py py-obj docutils literal notranslate"><span class="pre">infty</span></code></a> are aliases for
<a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>. For more details, see <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>.</p>
<p class="rubric">See Also</p>
<p>inf</p>
</dd></dl>

<dl class="data">
<dt id="numpy.PZERO">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">PZERO</code><a class="headerlink" href="#numpy.PZERO" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of positive zero.</p>
<p class="rubric">Returns</p>
<dl class="simple">
<dt>y<span class="classifier">float</span></dt><dd><p>A floating point representation of positive zero.</p>
</dd>
</dl>
<p class="rubric">See Also</p>
<p>NZERO : Defines negative zero.</p>
<p>isinf : Shows which elements are positive or negative infinity.</p>
<p>isposinf : Shows which elements are positive infinity.</p>
<p>isneginf : Shows which elements are negative infinity.</p>
<p>isnan : Shows which elements are Not a Number.</p>
<dl class="simple">
<dt>isfinite<span class="classifier">Shows which elements are finite - not one of</span></dt><dd><p>Not a Number, positive infinity and negative infinity.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). Positive zero is considered to be a finite number.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">PZERO</span>
<span class="go">0.0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">NZERO</span>
<span class="go">-0.0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">isfinite</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">PZERO</span><span class="p">])</span>
<span class="go">array([ True])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">PZERO</span><span class="p">])</span>
<span class="go">array([False])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">isinf</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">PZERO</span><span class="p">])</span>
<span class="go">array([False])</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="numpy.e">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">e</code><a class="headerlink" href="#numpy.e" title="Permalink to this definition">¶</a></dt>
<dd><p>Euler’s constant, base of natural logarithms, Napier’s constant.</p>
<p><code class="docutils literal notranslate"><span class="pre">e</span> <span class="pre">=</span> <span class="pre">2.71828182845904523536028747135266249775724709369995...</span></code></p>
<p class="rubric">See Also</p>
<p>exp : Exponential function
log : Natural logarithm</p>
<p class="rubric">References</p>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/E_%28mathematical_constant%29">https://en.wikipedia.org/wiki/E_%28mathematical_constant%29</a></p>
</dd></dl>

<dl class="data">
<dt id="numpy.euler_gamma">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">euler_gamma</code><a class="headerlink" href="#numpy.euler_gamma" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">γ</span> <span class="pre">=</span> <span class="pre">0.5772156649015328606065120900824024310421...</span></code></p>
<p class="rubric">References</p>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/Euler-Mascheroni_constant">https://en.wikipedia.org/wiki/Euler-Mascheroni_constant</a></p>
</dd></dl>

<dl class="data">
<dt id="numpy.inf">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">inf</code><a class="headerlink" href="#numpy.inf" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of (positive) infinity.</p>
<p class="rubric">Returns</p>
<dl class="simple">
<dt>y<span class="classifier">float</span></dt><dd><p>A floating point representation of positive infinity.</p>
</dd>
</dl>
<p class="rubric">See Also</p>
<p>isinf : Shows which elements are positive or negative infinity</p>
<p>isposinf : Shows which elements are positive infinity</p>
<p>isneginf : Shows which elements are negative infinity</p>
<p>isnan : Shows which elements are Not a Number</p>
<p>isfinite : Shows which elements are finite (not one of Not a Number,
positive infinity and negative infinity)</p>
<p class="rubric">Notes</p>
<p>NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.
Also that positive infinity is not equivalent to negative infinity. But
infinity is equivalent to positive infinity.</p>
<p><a class="reference internal" href="#numpy.Inf" title="numpy.Inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Inf</span></code></a>, <a class="reference internal" href="#numpy.Infinity" title="numpy.Infinity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Infinity</span></code></a>, <a class="reference internal" href="#numpy.PINF" title="numpy.PINF"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PINF</span></code></a> and <a class="reference internal" href="#numpy.infty" title="numpy.infty"><code class="xref py py-obj docutils literal notranslate"><span class="pre">infty</span></code></a> are aliases for <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">inf</span>
<span class="go">inf</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="p">])</span> <span class="o">/</span> <span class="mf">0.</span>
<span class="go">array([ Inf])</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="numpy.infty">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">infty</code><a class="headerlink" href="#numpy.infty" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of (positive) infinity.</p>
<p>Use <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a> because <a class="reference internal" href="#numpy.Inf" title="numpy.Inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Inf</span></code></a>, <a class="reference internal" href="#numpy.Infinity" title="numpy.Infinity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Infinity</span></code></a>, <a class="reference internal" href="#numpy.PINF" title="numpy.PINF"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PINF</span></code></a> and <a class="reference internal" href="#numpy.infty" title="numpy.infty"><code class="xref py py-obj docutils literal notranslate"><span class="pre">infty</span></code></a> are aliases for
<a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>. For more details, see <a class="reference internal" href="#numpy.inf" title="numpy.inf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inf</span></code></a>.</p>
<p class="rubric">See Also</p>
<p>inf</p>
</dd></dl>

<dl class="data">
<dt id="numpy.nan">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">nan</code><a class="headerlink" href="#numpy.nan" title="Permalink to this definition">¶</a></dt>
<dd><p>IEEE 754 floating point representation of Not a Number (NaN).</p>
<p class="rubric">Returns</p>
<p>y : A floating point representation of Not a Number.</p>
<p class="rubric">See Also</p>
<p>isnan : Shows which elements are Not a Number.</p>
<p>isfinite : Shows which elements are finite (not one of
Not a Number, positive infinity and negative infinity)</p>
<p class="rubric">Notes</p>
<p>NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.</p>
<p><a class="reference internal" href="#numpy.NaN" title="numpy.NaN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NaN</span></code></a> and <a class="reference internal" href="#numpy.NAN" title="numpy.NAN"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NAN</span></code></a> are aliases of <a class="reference internal" href="#numpy.nan" title="numpy.nan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">nan</span></code></a>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">nan</span>
<span class="go">nan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">nan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">([</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span>
<span class="go">array([        NaN,  0.        ,  0.69314718])</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="numpy.newaxis">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">newaxis</code><a class="headerlink" href="#numpy.newaxis" title="Permalink to this definition">¶</a></dt>
<dd><p>A convenient alias for None, useful for indexing arrays.</p>
<p class="rubric">See Also</p>
<p><a class="reference internal" href="../user/basics.indexing.html#module-numpy.doc.indexing" title="numpy.doc.indexing"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.doc.indexing</span></code></a></p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">newaxis</span> <span class="ow">is</span> <span class="kc">None</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">array([0, 1, 2])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[:,</span> <span class="n">newaxis</span><span class="p">]</span>
<span class="go">array([[0],</span>
<span class="go">[1],</span>
<span class="go">[2]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[:,</span> <span class="n">newaxis</span><span class="p">,</span> <span class="n">newaxis</span><span class="p">]</span>
<span class="go">array([[[0]],</span>
<span class="go">[[1]],</span>
<span class="go">[[2]]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[:,</span> <span class="n">newaxis</span><span class="p">]</span> <span class="o">*</span> <span class="n">x</span>
<span class="go">array([[0, 0, 0],</span>
<span class="go">[0, 1, 2],</span>
<span class="go">[0, 2, 4]])</span>
</pre></div>
</div>
<p>Outer product, same as <code class="docutils literal notranslate"><span class="pre">outer(x,</span> <span class="pre">y)</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[:,</span> <span class="n">newaxis</span><span class="p">]</span> <span class="o">*</span> <span class="n">y</span>
<span class="go">array([[ 0,  0,  0],</span>
<span class="go">[ 3,  4,  5],</span>
<span class="go">[ 6,  8, 10]])</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">x[newaxis,</span> <span class="pre">:]</span></code> is equivalent to <code class="docutils literal notranslate"><span class="pre">x[newaxis]</span></code> and <code class="docutils literal notranslate"><span class="pre">x[None]</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="n">newaxis</span><span class="p">,</span> <span class="p">:]</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(1, 3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="n">newaxis</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(1, 3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="kc">None</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(1, 3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[:,</span> <span class="n">newaxis</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(3, 1)</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="numpy.pi">
<code class="sig-prename descclassname">numpy.</code><code class="sig-name descname">pi</code><a class="headerlink" href="#numpy.pi" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">pi</span> <span class="pre">=</span> <span class="pre">3.1415926535897932384626433...</span></code></p>
<p class="rubric">References</p>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/Pi">https://en.wikipedia.org/wiki/Pi</a></p>
</dd></dl>

</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>